<!--
    @author Yancy Zhang
    @date 2022/4/5
    @description 博客后天管理菜单导航
-->
<template>
  <div class="lay-out">
    <el-container>
      <el-header
      > <i class="el-icon-s-platform"></i> <span class="title">Yancy's blog ——— Admin</span></el-header
      >
      <el-container>
        <el-aside width="150px">
          <el-menu
              :default-active="activeMenu"
              class="aside-menu"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
              :router="true"
              @select="select"
          >
            <el-menu-item index="/admin/manage-blog">
              <i class="el-icon-tickets"></i>
              <span slot="title">管理博客</span>
            </el-menu-item>
            <el-menu-item index="/admin/add-blog">
              <i class="el-icon-edit"></i>
              <span slot="title">新增博客</span>
            </el-menu-item>
            <el-menu-item index="/admin/edit-blog" disabled>
              <i class="el-icon-refresh"></i>
              <span slot="title">编辑博客</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <!--   菜单对应的路由界面    -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "LayOut",
  data() {
    return {
      activeMenu: "/admin/manage-blog",
    };
  },
  created() {
    this.activeMenu = this.$route.path;
  }
};
</script>

<style scoped>
.lay-out {
  height: 100vh;
  width: 100%;
}
/*侧边菜单样式*/
.aside-menu {
  min-height: calc(100vh - 60px);
  background-color: #545c64;
}
.el-header {
  background-color: #242f42;
  color: white;
  text-align: left;
  line-height: 60px;
}

.el-header .title{
  font-family: 'Press Start 2P';
}

.el-aside {
  color: black;
  text-align: center;
  background-color: #545c64;
}

.el-main {
  background-color: white;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>

